<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div.static{
            /* 粘性定位距离顶部的距离 */
            top: 0px;
            /* border: 2px 边框宽 边框为点 颜色; */
            border: 2px dotted black;
            /* 由中间向外填充 */
            padding: 2px;
            color: blue;
            /* 粘性定位始终能够被看到 */ 
            position: sticky;
        }
    </style>
</head>
<body>
    <div class="static">
        粘性定位
    </div>
    <div style="padding-bottom: 2000px;">
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
        <p>88888888888</p>
    </div>
</body>
</html>